package oakclub.entity;

import oakclub.service.UserService;
import oakclub.utility.DateUtility;

import java.util.Date;
import java.util.List;

public class UserEntity extends BaseEntity
{
    private long id;
    private String name;
    private String firstName;
    private String lastName;
    private String username;
    private String email;
    private PhotoEntity avatar;
    private List<PhotoEntity> photos;
    private VideoEntity video;
    private Date birthday;
    private GenderEntity gender;
    private GenderEntity interestedIn;
    private RelationshipEntity relationship;
    private EthnicityEntity ethnicity;
    private LocationEntity location;
    private LocationEntity hometown;
    private String aboutMe;
    private int weight;
    private int height;
    private XmppEntity xmpp;
    private boolean isVip;
    private TokenEntity token;
    private boolean isOnline;
    private VerificationEntity verification;
    private LanguageEntity locale;
    private List<LanguageEntity> languages;
    private List<SchoolEntity> schools;
    private List<WorkEntity> works;
    private List<FavoriteEntity> favorites;
    private boolean isPrivate;
    private boolean isEnabled;
    private boolean isStar;
    private boolean isApproved;
    private boolean isNewUser;
    private boolean isFinishedRegister;
    private Date createdTime;
    private Date lastLogin;
    private int numLiked;
    private int numViewed;

    public long getId()
    {
        return id;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getFirstName()
    {
        return firstName;
    }

    public void setFirstName(String firstName)
    {
        this.firstName = firstName;
    }

    public String getLastName()
    {
        return lastName;
    }

    public void setLastName(String lastName)
    {
        this.lastName = lastName;
    }

    public String getUsername()
    {
        return username;
    }

    public void setUsername(String username)
    {
        this.username = username;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public PhotoEntity getAvatar()
    {
        return avatar;
    }

    public void setAvatar(PhotoEntity avatar)
    {
        this.avatar = avatar;
    }

    public List<PhotoEntity> getPhotos()
    {
        return photos;
    }

    public void setPhotos(List<PhotoEntity> photos)
    {
        this.photos = photos;
    }

    public VideoEntity getVideo()
    {
        return video;
    }

    public void setVideo(VideoEntity video)
    {
        this.video = video;
    }

    public Date getBirthday()
    {
        return birthday;
    }

    public void setBirthday(Date birthday)
    {
        this.birthday = birthday;
    }

    public GenderEntity getGender()
    {
        return gender;
    }

    public void setGender(GenderEntity gender)
    {
        this.gender = gender;
    }

    public GenderEntity getInterestedIn()
    {
        return interestedIn;
    }

    public void setInterestedIn(GenderEntity interestedIn)
    {
        this.interestedIn = interestedIn;
    }

    public RelationshipEntity getRelationship()
    {
        return relationship;
    }

    public void setRelationship(RelationshipEntity relationship)
    {
        this.relationship = relationship;
    }

    public EthnicityEntity getEthnicity()
    {
        return ethnicity;
    }

    public void setEthnicity(EthnicityEntity ethnicity)
    {
        this.ethnicity = ethnicity;
    }

    public LocationEntity getLocation()
    {
        return location;
    }

    public void setLocation(LocationEntity location)
    {
        this.location = location;
    }

    public LocationEntity getHometown()
    {
        return hometown;
    }

    public void setHometown(LocationEntity hometown)
    {
        this.hometown = hometown;
    }

    public String getAboutMe()
    {
        return aboutMe;
    }

    public void setAboutMe(String aboutMe)
    {
        this.aboutMe = aboutMe;
    }

    public int getWeight()
    {
        return weight;
    }

    public void setWeight(int weight)
    {
        this.weight = weight;
    }

    public int getHeight()
    {
        return height;
    }

    public void setHeight(int height)
    {
        this.height = height;
    }

    public XmppEntity getXmpp()
    {
        return xmpp;
    }

    public void setXmpp(XmppEntity xmpp)
    {
        this.xmpp = xmpp;
    }

    public boolean isVip()
    {
        return isVip;
    }

    public void setVip(boolean isVip)
    {
        this.isVip = isVip;
    }

    public TokenEntity getToken()
    {
        return token;
    }

    public void setToken(TokenEntity token)
    {
        this.token = token;
    }

    public boolean isOnline()
    {
        return isOnline;
    }

    public void setOnline(boolean isOnline)
    {
        this.isOnline = isOnline;
    }

    public VerificationEntity getVerification()
    {
        return verification;
    }

    public void setVerification(VerificationEntity verification)
    {
        this.verification = verification;
    }

    public LanguageEntity getLocale()
    {
        return locale;
    }

    public void setLocale(LanguageEntity locale)
    {
        this.locale = locale;
    }

    public List<LanguageEntity> getLanguages()
    {
        return languages;
    }

    public void setLanguages(List<LanguageEntity> languages)
    {
        this.languages = languages;
    }

    public List<SchoolEntity> getSchools()
    {
        return schools;
    }

    public void setSchools(List<SchoolEntity> schools)
    {
        this.schools = schools;
    }

    public List<WorkEntity> getWorks()
    {
        return works;
    }

    public void setWorks(List<WorkEntity> works)
    {
        this.works = works;
    }

    public List<FavoriteEntity> getFavorites()
    {
        return favorites;
    }

    public void setFavorites(List<FavoriteEntity> favorites)
    {
        this.favorites = favorites;
    }

    public boolean isPrivate()
    {
        return isPrivate;
    }

    public void setPrivate(boolean isPrivate)
    {
        this.isPrivate = isPrivate;
    }

    public boolean isEnabled()
    {
        return isEnabled;
    }

    public void setEnabled(boolean isEnabled)
    {
        this.isEnabled = isEnabled;
    }

    public boolean isStar()
    {
        return isStar;
    }

    public void setStar(boolean isStar)
    {
        this.isStar = isStar;
    }

    public boolean isApproved()
    {
        return isApproved;
    }

    public void setApproved(boolean isApproved)
    {
        this.isApproved = isApproved;
    }

    public boolean isNewUser()
    {
        return isNewUser;
    }

    public void setNewUser(boolean isNewUser)
    {
        this.isNewUser = isNewUser;
    }

    public boolean isFinishedRegister()
    {
        return isFinishedRegister;
    }

    public void setFinishedRegister(boolean isFinishedRegister)
    {
        this.isFinishedRegister = isFinishedRegister;
    }

    public Date getCreatedTime()
    {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime)
    {
        this.createdTime = createdTime;
    }

    public Date getLastLogin()
    {
        return lastLogin;
    }

    public void setLastLogin(Date lastLogin)
    {
        this.lastLogin = lastLogin;
    }

    public int getNumLiked()
    {
        return numLiked;
    }

    public void setNumLiked(int numLiked)
    {
        this.numLiked = numLiked;
    }

    public int getNumViewed()
    {
        return numViewed;
    }

    public void setNumViewed(int numViewed)
    {
        this.numViewed = numViewed;
    }

    public String getProfileId()
    {
        return UserService.toProfileId(this.id);
    }

    public String getDisplayName()
    {
        int index = this.name.indexOf(' ');
        if(index == -1)
        {
            return this.name;
        }
        return this.name.substring(0, index);
    }

    public int getAge()
    {
        return DateUtility.calcAge(this.birthday);
    }
}
